1. Field of the Invention
The present invention relates to a random number test circuit capable of testing random number outputs simply and accurately, random number generation circuit, semiconductor integrated circuit, IC card and information terminal device.
2. Description of the Related Art
Random numbers are used in various fields, such as scientific computation fields, games, encryption fields, etc. In particular, in these years, there is an increasing demand for random number generation circuits in accordance with an increase in the importance of information security techniques. In the prior art, to realize a random number generation circuit by a small-scale circuit, pseudo-random number generation circuits utilizing a certain formula have been used. Such pseudo-random number generation circuits, however, generate random numbers based on certain computation, therefore their random number outputs are deterministic and hence have periodicity or regularity. In light of this, those random number circuits have come to be proposed, which utilize a physical phenomenon or noise and therefore can output high quality random numbers that have no periodicity or regularity, and which have a relatively small circuit scale.
When such a random number generation circuit as above is mounted on a chip, a test method different from conventional ones must be used.
In general, in a random number generation circuit, clock timing is adjusted and/or a sequential circuit is used, therefore holding of values using registers and computation are alternately performed. If computation is normal logical one that uses, for example, a conventional pseudo-random number circuit, a single output is uniquely determined from a single input. Accordingly, if the value of a register as an input is determined, the value of another register as an output is determined. Thus, the computation section can be checked for correctness by comparing all register values. However, if the computation section contains a certain analog component as in a random number generation circuit, i.e., if the computation section is devised not to produce definite values, it cannot be determined from register values whether the computation section is correctly operating.
Therefore, to test random number generation circuits of this type, it is necessary to acquire output data and subject it to a random number test, such as a statistical test (see, for example, Jpn. Pat. Appln. KOKAI Publication No. 2003-196081).
However, to perform a statistical test of a random number output, it is necessary to assign limited output pins to random number outputs in order to acquire the data concerning the random number generation circuit itself, and it is also necessary to perform processing different from that performed in other circuits. As a result, the circuit scale is inevitably increased.
To utilize random numbers of high quality in, for example, mobile phones, the random number test must be as simple as possible.
As a conventional simple test method, Cumulative Sums Test (Cu-Sum Test) is known, which is described in NIST SP 800-22 issued by the National Institute of Standards and Technology as an organ of the Department of Commerce of U.S. In this test, if the output is “1”, a value of +1 is assigned, while if the output is “0”, a value of −1 is assigned. Further, if the sum of the values exceeds a threshold value, it is determined to be abnormal. This method is effective if the output values of “1” and “0” are out of balance. However, where the same value is repeated in a certain cycle, e.g., “000111000111 . . . ”, the method is ineffective.
To avoid this, another test for testing repetition of a value is needed. For instance, manual testing may be performed, e.g., autocorrelation function be utilized, a Fourier transform be performed, or the number of repetitions of “1” or “0” be recorded and checked. However, manual testing, e.g., use of autocorrelation function or a Fourier transform, does not lead to reduction of effort and labor. Further, use of autocorrelation function or a Fourier transform, or record of repetitions does not define the number of random number bits that should be subjected to such tests. Actually, random numbers are generated more often in units of certain bits, such as 64 bits or 128 bits, than continuously. The above-mentioned method of using autocorrelation function, a Fourier transform or record of repetitions cannot deal with such random number sequences for various purposes.
Furthermore, if the test circuit is so small as not to obstruct the random number generation circuit, it may be contained in the random number generation circuit to output only a test signal and thereby reduce the number of pins. Actually, however, if the test circuit for performing the Cu-Sum Test and the other tests are contained, the resultant circuit scale is inevitably too large.
As described above, it is difficult for the prior art to test the periodicity of random number outputs in a simple way.